using System.Diagnostics.CodeAnalysis;
using System.ServiceModel;
using Bookvar.ObjectModel;
using Bookvar.ObjectModel.Actions.Collaboration;

namespace Bookvar.Collaboration.ServerSide
{
    [ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(ICollaborationServiceCallback))]
    public interface ICollaborationService
    {
        [OperationContract(IsOneWay = false, IsInitiating = true, IsTerminating = false)]
        UserJoinResponse Join(string name);

        [OperationContract(IsOneWay = true, IsInitiating = false, IsTerminating = true)]
        void Leave();

        [OperationContract(IsOneWay = true, IsInitiating = false, IsTerminating = false)]
        void ProcessAction(ActionBase action);

        [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Used as a method in service contract.")]
        [OperationContract(IsOneWay = false, IsInitiating = false, IsTerminating = false)]
        MindMap GetMindmap();
    }
}